<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h1>列表渲染2</h1>
    <ul>
      <!-- 当用v-for循环对象的时候，语法和循环数组是一样的 -->
      <!-- 循环对象的时候，有三个参数，分别是value, key, index -->
      <li v-for="(value, key, index) in myObject">
        {{ value }} - {{ key }} - {{ index }}
      </li>
    </ul>

    <hr>

    <!-- v-for可以对一个数字做循环，比如对5做循环，相当于是对[1,2,3,4,5] -->
    <span v-for="n in 10">{{ n }}</span>

    <hr>

    <!-- 九九乘法表 -->
    <div v-for="m in 9">
      <span v-for="n in m">{{m}} * {{n}} = {{m*n}}</span>
    </div>
  </div>

  <script src="../Vue.js"></script>

  <script>
    const { createApp } = Vue;

    createApp({
      data() {
        return {
          myObject: {
            title: 'How to do lists in Vue',
            author: 'Jane Doe',
            publishedAt: '2016-04-10'
          }
        }
      },
    }).mount("#app")

  </script>
</body>
</html>